<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        function register(){
            // 获取用户输入的数据
            var username = $('#username').val()
            var password = $('#password').val()
            var repassword = $('#repassword').val()
            var age = $('#age').val()
            var height = $('#height').val()

            // 发送Ajax请求，实现注册的功能
            $.ajax({
                type:'get',
                url:'http://localhost:8080/myweb/regist',
                data: {
                    username: username,
                    password:password,
                    age:age,
                    height:height
                },
                dataType:'json',
                success:function(result){
                    console.log(result)
                }

            })


        }
    </script>
</head>
<body>
  <h2>用户注册</h2>
  <div>
      用户名：<input type="text" id="username"> <br>
      密码：<input type="password" id="password"> <br>
      确认密码：<input type="password" id="repassword"> <br>
      年龄：<input type="text" id="age"> <br>
      身高：<input type="text" id="height"> <br>
      <input type="button" value="注  册" onclick="register()">
  </div>
</body>
</html>